Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved a startup issue with serial setup that could prevent the device from hashing #463

Closed
wants to merge 1 commit into from

Conversation

eandersson
Copy link
Collaborator

@eandersson eandersson commented Nov 9, 2024

Resolved a startup issue with serial setup that could prevent the device from hashing until a reboot. For an unknown reason, the setup process could fail unless we wait for each write to complete, leaving the device in a non-functional state. The fix ensures that all serial writes are completed before proceeding to the next task.

https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/uart.html#transmit-data

The easiest way to reproduce this is by disabling all logging.

diff --git a/main/main.c b/main/main.c
index dbc467b..8e7fb4e 100644
--- a/main/main.c
+++ b/main/main.c
@@ -35,6 +35,8 @@ void app_main(void)
 {
     ESP_LOGI(TAG, "Welcome to the bitaxe - hack the planet!");
 
+    esp_log_level_set("*", ESP_LOG_WARN);
+
     // Init I2C
     ESP_ERROR_CHECK(i2c_bitaxe_init());
     ESP_LOGI(TAG, "I2C initialized successfully");

@eandersson eandersson changed the title Fix serial race conditions on startup Fix serial race conditions on startup and tweak esp32 sdkoptions Nov 9, 2024
@eandersson eandersson changed the title Fix serial race conditions on startup and tweak esp32 sdkoptions Fix serial race conditions on startup and tweak esp32 sdk options Nov 9, 2024
@eandersson eandersson changed the title Fix serial race conditions on startup and tweak esp32 sdk options Fix serial race conditions on startup and tweak esp32 sdk options for better latency Nov 9, 2024
@eandersson eandersson force-pushed the serial_wait branch 2 times, most recently from dc4afcd to 03fcdfe Compare November 9, 2024 23:24
@mutatrum
Copy link
Contributor

This is related regarding the TPS546 code: #427.

@eandersson eandersson changed the title Fix serial race conditions on startup and tweak esp32 sdk options for better latency Fix serial race conditions on startup Nov 11, 2024
@WantClue WantClue requested a review from skot November 16, 2024 21:57
@WantClue WantClue added help wanted Extra attention is needed accepted This issue will be worked on labels Nov 16, 2024
@eandersson eandersson changed the title Fix serial race conditions on startup Resolved a startup issue with serial setup that could prevent the device from hashing Nov 20, 2024
@eandersson eandersson closed this Nov 20, 2024
@eandersson eandersson deleted the serial_wait branch November 29, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue will be worked on help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants